#ifndef SEARCH_H
#define SEARCH_H

#include <QtWidgets>
#include <QLabel>
#include <QTimer>
#include <QDateTime>
#include <QUdpSocket>
#include <QTcpSocket>
#include <QHostAddress>
#include <QTimer>
#include <QDebug>

#include <iostream>
namespace Ui {
class Search;
}

class Search : public QWidget
{
    Q_OBJECT

public:
    explicit Search(QWidget *parent = 0);
    ~Search();
public slots:
    void updateTime();
private slots:
    void on_pushButton_clicked();
    void processPendingDatagrams();

    void btnSearchSlot();
    void udpRecvSlot();//接收广播回复
signals:
    void searchSignal(QString url);
private:
    Ui::Search *ui;

    QUdpSocket *udpSocket;//udp socket对象
    QTcpSocket *socket;//TCP客户端对象
    QTcpSocket *fliesocket;//tcp文件对象
    QString tcpip;//服务器IP地址
};

#endif // SEARCH_H
